'''

setStyle()
QstyleFactory()  当前平台支持的样式
QApplication.setStyle()  设置样式

'''
import sys
from PyQt5.QtWidgets import *
from PyQt5.QtCore import *
from PyQt5.QtGui import *
class AppWidget(QWidget):
    def __init__(self,parent=None):
        super(AppWidget,self).__init__(parent)
        self.setWindowTitle("QSS")
        combo=QComboBox(self)
        combo.setObjectName('mycombo')
        combo.addItems(["java","python","js"])
        combo.move(30,30)
        self.setGeometry(300,300,350,200)
        self.setWindowTitle("combox")


        # qssStyle='''
        # QPushButton[name='btn2']{background-color:red}
        # '''

        qssStyle = '''
               QComboBox#mycombo::drop-down {image:url(panda.jpg)}
               QComboBox#mycombo::drop-down :hover{background-color:red;}
               '''
        self.setStyleSheet(qssStyle)


if __name__ == '__main__':
    app=QApplication(sys.argv)
    win=AppWidget()
    win.show()
    sys.exit(app.exec_())